import {Component, Input} from '@angular/core';

/**
 * 手风琴下拉
 */
@Component({
  selector: 'office-accordion',
  templateUrl: 'office-accordion.html'
})
export class OfficeAccordionComponent {

  @Input() helpList: Array<any>= [];
  private index: string;
  constructor()
  {}
  /*** 页面加载时运行。
   * */
  ngOnInit()
  {
    this.index = this.helpList[0]? this.helpList[0].id: 0;
  }

  /*** 执行打开详情
   * */
  executeOpenDetail(index: string)
  {
    if(this.index === index)
    {
      this.index+='haha';
      return;
    }
    this.index = index;
  }

}
